package lishe.myrefreshview;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.List;

import lishe.myrefreshview.MyResyclerView.RecycleBaseAdapter;

/**
 * Created by shino on 2017/9/23.
 */

public class MyAdapter extends RecycleBaseAdapter {
    Context context;
    List<String> list;

    public MyAdapter(Context context) {
        this.context = context;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolderMy(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item,null);
        MyHolder holder = new MyHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolderMy(RecyclerView.ViewHolder holder, int position) {
        ((MyHolder)holder).tv.setText("测试"+position);
    }

    @Override
    public int getItemCountMy() {
        return 50;
    }


    class MyHolder extends RecyclerView.ViewHolder {
        TextView tv;

        public MyHolder(View itemView) {
            super(itemView);
            tv = itemView.findViewById(R.id.tv);
        }
    }
}
